Skip to content

Conversation

@songgaoye
Copy link
Contributor

@songgaoye songgaoye commented Oct 28, 2025

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

Summary by CodeRabbit

  • Chores

    • Migrated storage and versioned-DB implementation to an external cronos-store module; updated build, Makefile, proto tooling, and CI workflows.
    • Removed legacy in-repo storage subsystems (IAVL/memiavl, snapshotting, WAL, proofing, versioned store) and related CLI utilities.
  • Documentation

    • Deleted internal READMEs and developer docs for snapshots, VersionDB, and storage internals.
  • Tests

    • Removed numerous package-level tests and benchmarks covering storage, snapshots, proofs, and tooling.

✏️ Tip: You can customize this high-level summary in your review settings.

@songgaoye songgaoye requested a review from a team as a code owner October 28, 2025 10:02
@songgaoye songgaoye requested review from calvinaco and thomas-nguy and removed request for a team October 28, 2025 10:02
@github-actions

This comment has been minimized.

@github-actions github-actions bot added the build label Oct 28, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2025

Walkthrough

Removed in-repo memiavl/versiondb/store implementations, related tools/tests, and memiavl wiring; replaced internal modules and imports with external github.com/crypto-org-chain/cronos-store modules; updated app callsite to pass chainId to memiavl setup; adjusted proto go_package options and proto-gen script; consolidated Makefile/CI/test flows.

Changes

Cohort / File(s) Change Summary
Core libraries removed
memiavl/..., versiondb/..., store/...
Deleted in-repo implementations and public APIs for memiavl, versiondb, tsrocksdb, extsort, rootmulti and related packages — including snapshots, WAL, proofs, exporters/importers, iterators, node/layout/persisted implementations, many helpers, and a large set of CLI/tools and tests.
App callsites & small updates
app/app.go, app/bench_test.go, cmd/cronosd/cmd/root.go, cmd/cronosd/cmd/versiondb.go
Updated import paths to github.com/crypto-org-chain/cronos-store/...; SetupMemIAVL call in app/app.go now receives chainId from flags.
Module & dependency replacements
go.mod, gomod2nix.toml, removed memiavl/go.mod, store/go.mod, versiondb/go.mod
Replaced local modules with cronos-store equivalents in go.mod and added gomod2nix replacements; removed several submodule go.mod files.
Protobuf & proto tooling
proto/memiavl/*.proto, scripts/protocgen.sh
Updated proto option go_package to github.com/crypto-org-chain/cronos-store/memiavl; changed protocgen script to optionally sync protos from an external cronos-store checkout.
Build / CI / Makefile
Makefile, .github/workflows/build.yml, .github/workflows/lint.yml
Consolidated test targets into a single make test; added CRONOS_STORE_* variables and proto container hooks; reduced per-submodule CI lint/test/coverage steps.
Store config & wiring removed
store/config/*, store/setup.go, store/rootmulti/*, store/memiavlstore/*, store/cachemulti/store.go
Removed memiavl config types/templates and SetupMemIAVL wiring; deleted rootmulti multi-store implementation, memiavl-backed store wrappers, cachemulti closer wrapper, and related snapshot/export/import wiring.
VersionDB client & CLI removed
versiondb/client/*
Deleted many versiondb CLI commands (dump, verify, restore, convert-to-sst, ingest-sst, fixdata, to_versiondb), utilities, and tests.
Tests & benches removed
memiavl/*, versiondb/*, store/*
Removed extensive unit and integration tests and test helpers associated with removed components (benchmarks, snapshot/iterator/proof/wal tests, and many client tests).

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

  • Areas needing extra attention:
    • Consistency of all import path replacements to github.com/crypto-org-chain/cronos-store and go.mod/gomod2nix pinned versions.
    • Correctness of the new SetupMemIAVL signature (chainId parameter) and any remaining call sites.
    • Search for and resolve any lingering references to removed public types/APIs (memiavl, versiondb, tsrocksdb, extsort, rootmulti, CLI commands) to avoid build breaks.
    • Validate proto changes and the altered scripts/protocgen.sh behavior in CI and local workflows.
    • Makefile/CI changes — ensure coverage uploads, lint steps, and proto-checking against external repo function as intended.

Suggested labels

cronos

Suggested reviewers

  • calvinaco
  • thomas-nguy
  • JayT106

Poem

🐇 I hopped through code with nimble feet,

I packed up trees and snapshots neat.
Imports rewired, old roots set free,
Cronos-store now holds the key.
Thump-thump — a tiny migration feat!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'feat: use cronos store' clearly and concisely summarizes the main change: migrating to use the cronos-store module.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch song/use_cronos_store

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a605274 and ae49321.

📒 Files selected for processing (1)
  • Makefile (3 hunks)
🧰 Additional context used
🪛 checkmake (0.2.2)
Makefile

[warning] 344-344: Missing required phony target "all"

(minphony)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: integration_tests (mint)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: Run golangci-lint
  • GitHub Check: build (macos-14)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: build (macos-latest)
  • GitHub Check: unittest
  • GitHub Check: gomod2nix
  • GitHub Check: Analyze (go)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
Makefile (1)

292-305: The extraction logic is sound and handles both replace and non-replace directives correctly. The awk fallback on line 294 successfully extracts the version from replace directives (matched v0.0.0-20251119030934-19a930cec475 from line 288 of go.mod), and the sed fallback serves as an additional safety net for non-replace directives. The patterns correctly account for leading whitespace, and the sequence of fallbacks ensures reliable version extraction across different go.mod configurations.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@songgaoye songgaoye marked this pull request as draft October 28, 2025 10:04
@socket-security
Copy link

socket-security bot commented Oct 28, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgolang/​github.com/​crypto-org-chain/​cronos-store/​versiondb@​v0.0.0-20251119030934-19a930cec475100100100100100
Addedgolang/​github.com/​crypto-org-chain/​cronos-store/​store@​v0.0.0-20251119030934-19a930cec475100100100100100

View full report

@songgaoye songgaoye marked this pull request as ready for review November 18, 2025 09:18
@github-actions github-actions bot added the ci label Nov 19, 2025
@thomas-nguy
Copy link
Collaborator

Can you change the PR target to be main branch?

@songgaoye songgaoye force-pushed the song/use_cronos_store branch from 77721c2 to aff8700 Compare November 19, 2025 13:23
@songgaoye songgaoye changed the base branch from release/v1.5.x to main November 19, 2025 13:24
@songgaoye
Copy link
Contributor Author

sure

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6d8020b and b3084c6.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (2)
  • go.mod (3 hunks)
  • gomod2nix.toml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (22)
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: integration_tests (mint)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: Run golangci-lint
  • GitHub Check: build (macos-14)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: unittest
  • GitHub Check: build (macos-latest)
  • GitHub Check: gomod2nix
  • GitHub Check: Analyze (go)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
gomod2nix.toml (1)

259-270: ****

The claim of a version mismatch is inaccurate. Go.mod contains a replace directive that explicitly redirects github.com/crypto-org-chain/cronos-store/memiavl from the constraint v0.0.4 to the replacement version v0.0.0-20251119030934-19a930cec475, which matches the gomod2nix.toml entries. Replace directives take precedence in Go module resolution—no mismatch exists and no correction is needed.

Likely an incorrect or invalid review comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
app/app.go (1)

433-434: Consider adding validation to ensure chainId is provided before passing to SetupMemIAVL.

The chainId parameter is retrieved from application options but passed directly to SetupMemIAVL without validation. While the standard pattern in Cosmos SDK apps retrieves config values this way, adding a check to ensure chainId is non-empty would provide defensive validation, particularly in edge cases or misconfigured environments where the flag might not be set:

 chainId := cast.ToString(appOpts.Get(flags.FlagChainID))
+if chainId == "" {
+	panic("chainId must be provided for memiavl setup")
+}
 baseAppOptions = memiavlstore.SetupMemIAVL(logger, homePath, appOpts, false, false, cacheSize, chainId, baseAppOptions)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2ae79df and 63b730a.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (5)
  • CHANGELOG.md (1 hunks)
  • app/app.go (2 hunks)
  • cmd/cronosd/cmd/root.go (1 hunks)
  • go.mod (3 hunks)
  • gomod2nix.toml (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • go.mod
  • gomod2nix.toml
  • cmd/cronosd/cmd/root.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (mint)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (macos-14)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: gomod2nix
  • GitHub Check: Analyze (go)
  • GitHub Check: Run golangci-lint
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
app/app.go (1)

44-44: External module dependency is properly declared and versioned.

The import path change to github.com/crypto-org-chain/cronos-store/store is correctly reflected in go.mod with version v0.0.0-20251119030934-19a930cec475. The external dependency is consistently used across the codebase and properly maintained.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
Makefile (1)

329-331: Consider adding vulncheck to a .PHONY declaration.

The vulncheck target is functionally correct, but lacks a .PHONY declaration. While this doesn't affect functionality (since the directory dependency makes it safe), explicitly marking it as .PHONY would improve clarity and prevent accidental issues if a vulncheck file is ever created in the repository.

 vulncheck: $(BUILDDIR)/
 	GOBIN=$(BUILDDIR) go install golang.org/x/vuln/cmd/govulncheck@latest
 	$(BUILDDIR)/govulncheck ./...
+
+.PHONY: vulncheck
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 63b730a and 0a61cc3.

📒 Files selected for processing (2)
  • .github/workflows/build.yml (2 hunks)
  • Makefile (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/build.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: Run golangci-lint
  • GitHub Check: Analyze (go)
  • GitHub Check: build (macos-14)
  • GitHub Check: gomod2nix
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: unittest
  • GitHub Check: build (macos-latest)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (mint)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (2)
Makefile (2)

112-113: Consolidated test target looks good.

The unified test target appropriately consolidates separate submodule test invocations (test-memiavl, test-store, test-versiondb) into a single entry point. The use of -tags=objstore is consistent with other test targets throughout the Makefile, and coverage profiling setup is correct.


115-115: PHONY declaration correctly updated.

The PHONY declaration appropriately removes the now-consolidated submodule test targets. The minimal declaration for core targets is consistent with this file's pattern of grouping PHONY declarations by functional section (see lines 145, 214-222, etc.).

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
Makefile (1)

105-115: Add all to .PHONY targets for Makefile best practices.

The all target at line 105 should be declared as .PHONY to prevent conflicts with files named all in the repository root. This is flagged by static analysis tools and is a Makefile best practice.

Apply this diff to fix:

-all: build
+all: build
 build: check-network print-ledger go.sum
 	@go build -mod=readonly $(BUILD_FLAGS) -o $(BUILDDIR)/cronosd ./cmd/cronosd
 
 install: check-network print-ledger go.sum
 	@go install -mod=readonly $(BUILD_FLAGS) ./cmd/cronosd
 
 test:
 	@go test -tags=objstore -v -mod=readonly $(PACKAGES) -coverprofile=$(COVERAGE) -covermode=atomic
 
-.PHONY: clean build install test
+.PHONY: all clean build install test
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0a61cc3 and d5dacc7.

📒 Files selected for processing (2)
  • Makefile (3 hunks)
  • scripts/protocgen.sh (1 hunks)
🧰 Additional context used
🪛 checkmake (0.2.2)
Makefile

[warning] 341-341: Missing required phony target "all"

(minphony)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (macos-14)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: unittest
  • GitHub Check: gomod2nix
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (mint)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: Run golangci-lint
  • GitHub Check: Analyze (go)
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (4)
Makefile (3)

112-115: Consolidation of test targets is appropriate.

The single test target correctly consolidates the removed per-submodule targets (test-memiavl, test-store, test-versiondb) after the extraction of these packages to cronos-store. The test invocation remains correct.


334-338: Proto breaking change checks correctly split between repos.

The proto-check-breaking target appropriately separates validation: Cronos protos are checked against cronos main branch (excluding memiavl), while memiavl protos are validated against the cronos-store version derived from go.mod. This aligns with the package extraction.


290-302: The version extraction logic in the Makefile works correctly for the current go.mod state.

The sed pattern correctly extracts v0.0.4 from the cronos-store/memiavl dependency in go.mod. Since this version contains no hyphen, it is correctly classified as a tag (CRONOS_STORE_REF_TARGET := tag). The logic appropriately handles the fallback to the main branch if the version extraction returns empty.

scripts/protocgen.sh (1)

20-30: Remove concern about cronos-store proto file generation.

The memiavl proto files in proto/memiavl/ specify option go_package = github.com/crypto-org-chain/cronos-store/memiavl, so the buf generate loop on lines 7–14 automatically generates the cronos-store memiavl files to the github.com/crypto-org-chain/cronos-store/memiavl/ directory. The sync step on line 29 copies files that are guaranteed to exist after buf generation completes.

Likely an incorrect or invalid review comment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
Makefile (1)

292-308: Verify robustness of CRONOS_STORE_VERSION extraction fallback logic.

The version extraction uses multiple fallback methods: go list -m (line 292), awk on => lines (line 294), sed on normal go.mod lines (line 297), and finally defaults to "main" (line 306). The awk pattern at line 294 extracts $$NF from lines containing =>, which may match local replace paths (e.g., /local/path) rather than semantic versions. Verify that:

  1. The intended input format is github.com/crypto-org-chain/cronos-store/memiavl => v1.0.0 (with version suffix), not just a bare path.
  2. The pattern matching at line 297 correctly handles the standard go.mod format without =>.
  3. The fallback to "main" provides adequate safety if neither extraction succeeds.

Although the fallback chain prevents breakage, clarifying or hardening this logic would improve maintainability.

Consider adding a comment above line 291 documenting the intended extraction precedence and format assumptions.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d5dacc7 and 67014ba.

📒 Files selected for processing (1)
  • Makefile (3 hunks)
🧰 Additional context used
🪛 checkmake (0.2.2)
Makefile

[warning] 347-347: Missing required phony target "all"

(minphony)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: build (macos-latest)
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: gomod2nix
  • GitHub Check: build (macos-14)
  • GitHub Check: unittest
  • GitHub Check: Run golangci-lint
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (mint)
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: Analyze (go)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (1)
Makefile (1)

340-344: Proto-check-breaking logic cleanly separates base and memiavl checks.

The split between checking Cronos protobufs (excluding memiavl, against main branch) and memiavl protobufs (against cronos-store using derived ref) is well-structured. The use of CRONOS_STORE_REF and CRONOS_STORE_REF_TARGET correctly aligns with the version derivation logic above.

@cd versiondb; go test -tags=objstore,rocksdb -v -mod=readonly ./... -coverprofile=$(COVERAGE) -covermode=atomic;

.PHONY: clean build install test test-memiavl test-store test-versiondb
.PHONY: clean build install test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing all target in .PHONY declaration.

The all target is defined at line 105 but is not declared as phony at line 115. This can cause Make to treat all as a file target, potentially leading to incorrect behavior.

Apply this diff to fix the .PHONY declaration:

-.PHONY: clean build install test
+.PHONY: all clean build install test
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.PHONY: clean build install test
.PHONY: all clean build install test
🤖 Prompt for AI Agents
In Makefile around line 115, the .PHONY declaration omits the existing all
target defined at line 105; update the .PHONY line to include all (e.g., add
"all" to the list) so Make treats it as a phony target rather than a file.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

♻️ Duplicate comments (1)
Makefile (1)

115-115: Missing all target in .PHONY declaration (duplicate of prior comment).

The all target defined at line 105 is not included in the .PHONY declaration. This issue was flagged in a previous review but remains unfixed.

Apply this diff to fix the .PHONY declaration:

-.PHONY: clean build install test
+.PHONY: all clean build install test
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 67014ba and 986d80e.

📒 Files selected for processing (1)
  • Makefile (3 hunks)
🧰 Additional context used
🪛 checkmake (0.2.2)
Makefile

[warning] 344-344: Missing required phony target "all"

(minphony)

🪛 GitHub Actions: Protobuf
Makefile

[error] 341-341: Command failed: make proto-check-breaking. Failure: no .proto target files found.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: build (macos-14)
  • GitHub Check: gomod2nix
  • GitHub Check: build (macos-latest)
  • GitHub Check: unittest
  • GitHub Check: build (ubuntu-latest)
  • GitHub Check: Run golangci-lint
  • GitHub Check: integration_tests (gas)
  • GitHub Check: integration_tests (slow)
  • GitHub Check: integration_tests (mint)
  • GitHub Check: integration_tests (ibc_update_client)
  • GitHub Check: integration_tests (upgrade)
  • GitHub Check: integration_tests (gov)
  • GitHub Check: integration_tests (ica)
  • GitHub Check: integration_tests (ibc_rly_evm)
  • GitHub Check: integration_tests (ibc_timeout)
  • GitHub Check: integration_tests (unmarked)
  • GitHub Check: integration_tests (ibc)
  • GitHub Check: integration_tests (ibc_rly_gas)
  • GitHub Check: Analyze (go)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: semgrep-cloud-platform/scan

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (2)
Makefile (2)

115-115: Add all target to .PHONY declaration.

The all target is defined at line 105 but missing from the .PHONY declaration at line 115. This can cause Make to treat all as a file target rather than a phony target.

Apply this diff to fix it:

-.PHONY: clean build install test
+.PHONY: all clean build install test

292-305: Fix the CRONOS_STORE_VERSION extraction fallback patterns.

The awk pattern at line 294 anchors with ^github.com/..., expecting the module to start at the line's beginning. However, go.mod indents entries with tabs, so this pattern will never match. The sed fallback at line 297 has similar issues and produces incorrect output ("=>") when applied to the replace directive format.

Test the version extraction against actual go.mod content before relying on these fallbacks, or simplify the logic to depend primarily on the go list command at line 292, which works correctly.

Consider applying this more robust approach:

-CRONOS_STORE_VERSION := $(shell go list -m -f '{{if .Replace}}{{.Replace.Version}}{{else}}{{.Version}}{{end}}' github.com/crypto-org-chain/cronos-store/memiavl 2>/dev/null)
-ifeq ($(CRONOS_STORE_VERSION),)
-  CRONOS_STORE_VERSION := $(shell awk '/^github.com\/crypto-org-chain\/cronos-store\/memiavl[[:space:]]+=>/ {print $$NF; exit}' go.mod)
-endif
-ifeq ($(CRONOS_STORE_VERSION),)
-  CRONOS_STORE_VERSION := $(shell sed -n 's/^[[:space:]]*github.com\/crypto-org-chain\/cronos-store\/memiavl[[:space:]]\+\([^[:space:]]\+\).*/\1/p' go.mod | head -n 1)
-endif
+CRONOS_STORE_VERSION := $(shell go list -m -f '{{if .Replace}}{{.Replace.Version}}{{else}}{{.Version}}{{end}}' github.com/crypto-org-chain/cronos-store/memiavl 2>/dev/null || grep 'cronos-store/memiavl' go.mod | awk '{print $$NF}' | head -n 1)
🧹 Nitpick comments (1)
Makefile (1)

337-341: Proto-check-breaking for memiavl now skips gracefully but consider removing the check entirely.

Line 341 now includes || echo "Warning: memiavl proto check skipped..." to handle the missing proto/memiavl directory gracefully. While this is an improvement over a hard failure, it still attempts to run a buf check that will always fail on this path.

Since proto/memiavl was moved to the external cronos-store module, either remove this check entirely (cleaner approach) or implement a proper guard that checks for directory existence before running buf:

 proto-check-breaking:
 	@echo "Checking Cronos protobuf files for breaking changes"
 	@$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main --exclude-path proto/memiavl
-	@echo "Checking memiavl protobuf files against cronos-store ref $(CRONOS_STORE_REF)"
-	@$(protoImage) buf breaking --path proto/memiavl --against $(CRONOS_STORE_GIT)#ref=$(CRONOS_STORE_REF) || echo "Warning: memiavl proto check skipped (files may not exist in cronos-store yet)"

Or, if proto definitions still exist in cronos-store and need verification, add a proper directory check:

 proto-check-breaking:
 	@echo "Checking Cronos protobuf files for breaking changes"
 	@$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main --exclude-path proto/memiavl
+	@if [ -d proto/memiavl ]; then \
+		echo "Checking memiavl protobuf files against cronos-store ref $(CRONOS_STORE_REF)"; \
+		$(protoImage) buf breaking --path proto/memiavl --against $(CRONOS_STORE_GIT)#ref=$(CRONOS_STORE_REF); \
+	fi
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 986d80e and a605274.

📒 Files selected for processing (1)
  • Makefile (3 hunks)
🧰 Additional context used
🪛 checkmake (0.2.2)
Makefile

[warning] 344-344: Missing required phony target "all"

(minphony)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants